<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['算法管理','GPS检测记录']" icon="fa fa-subscript" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>GPS检测记录</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 300px);">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="top_module top_module_box" style="min-width: auto;">
									<span class="top_module_label module_text">时间类型</span>
									<select name="" class="top_module_select" style="min-width: 110px;" [(ngModel)]="timeType">
										<option value="1">异常开始时间</option>
										<option value="2">异常结束时间</option>
										<option value="3">创建时间</option>
										<option value="4">更新时间</option>
									</select>
								</div>
								<div class="top_module top_module_box" style="min-width: auto;">
									<span class="top_module_label module_text">异常类型</span>
									<select name="" class="top_module_select" style="min-width: 110px;" [(ngModel)]="exceptionType">
										<option value="">全部</option>
										<option value="1">大段丢失</option>
										<option value="2">无GPS</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker3"  autocomplete="off" placeholder="选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker4"  autocomplete="off" placeholder="选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
							</div>
							<!-- <div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="地址">
								<span class="top-search-box">
										<button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
								</span>
							</div> -->
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>所属公司</th>
										<th>车牌号码</th>
										<th>设备编码</th>
										<th>异常开始时间</th>
										<th>异常结束时间</th>
										<th>异常类型</th>
										<th>创建时间</th>
										<th>更新时间</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i" [ngClass]="{selected:activeSelected === row.id}" (dblclick)='checkAbnormal(row)'>
										<td>{{row.companyName}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.exceptionStartTime}}</td>
										<td>{{row.exceptionEndTime}}</td>
										<td>
											<span *ngIf="row.exceptionType == 1">大段丢失</span>
											<span *ngIf="row.exceptionType == 2">无GPS</span>
										</td>
										<td>{{row.createTime}}</td>
										<td>{{row.updateTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
												[rows]="pageSize"
												[currentPage]="curPage - 1"
												(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>

	<!--折线图-->
	<div  style="background: white;border-radius: 5px;margin-top: 5px;position: relative;" [hidden]='!isChartView'>
		<button (click)="closeChart()" class="div_closeBtn"> × </button>
		<div class="widget-body no-padding" style="margin: 0;">
			<div class="page-header clearfix s_table_opreation" style="margin: 0;">
				<div class="left page-header-btn" style="padding: 5px;">
					<div class="top_module">
						<span class="module_text" style="background: none;" >异常数据折线图</span>
					</div>
					<div style="display: inline-block;">
						<div>
							<div class="selectDate top_module">
								<table-select-date [notInit]='true' [specifyTime]='specifyTimeChart' (outerTime)="getSelectChartTime($event)" ></table-select-date>
							</div>
							<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
						</div>
					</div>
				</div>
			</div>
		</div>

		<sa-chart-bmap [height]='325' [offDatas]='true' [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)'
			[isAuditData]='false'	[isShowModify]='false'></sa-chart-bmap>
		<div [hidden]='!isMapView'>
			<sa-bmap-chart [trackParams]='drawTrackArr' [isShowBmap]='isMapView' deviceId="deviceId"></sa-bmap-chart>
		</div>
	</div>
	<!--折线图end-->
</div>